﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RoleList.aspx.cs" Inherits="StudentManage.Web.Admin.Management.SysManage.RoleList" %>

<%@ Register src="/Admin/PageHead/UC_Head.ascx" tagname="UC_Head" tagprefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <uc1:UC_Head ID="UC_Head1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <asp:HiddenField ID="hfRoleCode" runat="server" />
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td width="17" height="29" valign="top" background="../images/mail_leftbg.gif">
                <img src="../../images/left-top-right.gif" width="17" height="29" />
            </td>
            <td height="29" valign="top" background="../images/content-bg.gif">
                <table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg"
                    id="table2">
                    <tr>
                        <td height="31">
                            <div class="titlebt">角色列表</div>
                        </td>
                    </tr>
                </table>
            </td>
            <td width="16" valign="top" background="../images/mail_rightbg.gif">
                <img src="../../images/nav-right-bg.gif" width="16" height="29" />
            </td>
        </tr>
        <tr>
            <td height="71" valign="middle" background="../../images/mail_leftbg.gif">
                &nbsp;
            </td>
            <td valign="top" bgcolor="#F7F8F9">
                <table width="100%" height="138" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td height="13" valign="top">
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td valign="top">
                            <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td class="left_txt">
                                        当前位置：角色列表
                                    </td>
                                </tr>
                                <tr>
                                    <td height="1" bgcolor="#CCC">
                                    </td>
                                </tr>
                                <tr>
                                    <td style="padding-top: 10px; padding-bottom: 10px;">
                                        <div class="BasicDataBtn" style="border: 1px solid #999; background-color: rgb(242, 242, 242);
                                            padding: 10px 10px;">
                                            <table width="100%" border="0" cellpadding="0" cellspacing="0" node-type="header_table">
                                                <tr>
                                                    <td align="right" style="width: 60px;">
                                                        角色名称:
                                                    </td>
                                                    <td align="left" style="width: 180px;">
                                                        <asp:TextBox runat="server" ID="txt_roleName" />
                                                    </td>
                                                    <td align="right" style="width: 60px;">
                                                        角色描述:
                                                    </td>
                                                    <td align="left" style="width: 180px;">
                                                        <asp:TextBox runat="server" ID="txt_roledesc" />
                                                    </td>
                                                    <td style="width: 90px;">
                                                        <asp:Button Text="添加角色" runat="server" ID="btAddRole" OnClick="btAddRole_Click" />
                                                    </td>
                                                    <td style="width: 90px;">
                                                        <asp:Button Text="删除角色" runat="server" ID="btDeleteRole" OnClick="btDeleteRole_Click" />
                                                    </td>
                                                    <td style="width: 90px;">
                                                        <asp:Button Text="修改角色" runat="server" ID="btModfiyRole" OnClick="btModfiyRole_Click" />
                                                    </td>
                                                    <td style="width: 90px;">
                                                        <asp:Button Text="保存权限" runat="server" ID="btSavePrivilege" OnClick="btSavePrivilege_Click" />
                                                    </td>
                                                    <td>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                            <tr>
                                                <td valign="top" style="width:155px;">
                                                    <div class="sp-box-list">
                                                        <h3>
                                                            角色列表</h3>
                                                        <ul style="width: 150px; height: 500px; overflow-x: hidden; overflow-y: auto;">
                                                            <asp:Repeater runat="server" ID="repRoleList">
                                                                <ItemTemplate>
                                                                    <li>
                                                                        <asp:LinkButton Text='<%#Eval("Name") %>' ToolTip='<%#Eval("Name") %>' CommandArgument='<%#Eval("Value") %>'
                                                                            ID="roleAct" OnClick="roleAct_Click" runat="server" />
                                                                    </li>
                                                                </ItemTemplate>
                                                            </asp:Repeater>
                                                        </ul>
                                                    </div>
                                                </td>
                                                <td style="width:10px;">
                                                </td>
                                                <td valign="top">
                                                    <div class="sp-box">
                                                        <div class="sp-top-panel">
                                                            <h3>权限模块</h3>
                                                        </div>
                                                        <div>
                                                            <asp:Repeater runat="server" ID="repPrivModule" OnItemDataBound="repPrivModule_ItemDataBound">
                                                                <ItemTemplate>
                                                                    <div class="sp-priv-sub-box">
                                                                        <div class="sp-title">
                                                                            <%# Eval("CategoryName") %>
                                                                        </div>
                                                                        <div class="sp-sub-box">
                                                                            <asp:Repeater runat="server" ID="subPageList" OnItemDataBound="subPageList_ItemDataBound">
                                                                                <ItemTemplate>
                                                                                    <div class="sp-page">
                                                                                        <b>
                                                                                            <asp:CheckBox Text='<%# Eval("PageName") %>' PrivType='<%# Eval("PrivType") %>' PrivCode='<%# Eval("Value") %>'
                                                                                                ID="PageViewPrivilege" runat="server" />
                                                                                        </b>
                                                                                        <asp:CheckBoxList OnDataBound="subPrivs_ItemDataBound" Style="margin-left: 2em;"
                                                                                            ID="subPrivs" runat="server" RepeatDirection="Horizontal">
                                                                                        </asp:CheckBoxList>
                                                                                    </div>
                                                                                </ItemTemplate>
                                                                            </asp:Repeater>
                                                                        </div>
                                                                    </div>
                                                                </ItemTemplate>
                                                            </asp:Repeater>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>
                                        <script type="text/javascript">
                                            $("[id*=PageViewPrivilege]").click(function () {
                                                $(this).parents("div.sp-page").find("input[type=checkbox]").attr('checked', this.checked);
                                            })
                                            $("[id*=subPrivs] input[type=checkbox]").click(function () {
                                                var count = $("[id*=subPrivs] input:checked").length;
                                                if (count == 0) return;
                                                $(this).parents("div.sp-page").find("[id*=PageViewPrivilege]").attr('checked', count > 0);
                                            })
                                        </script>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
            <td background="../../images/mail_rightbg.gif">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td valign="middle" background="../images/mail_leftbg.gif">
                <img src="../../images/buttom_left2.gif" width="17" height="17" />
            </td>
            <td height="17" valign="top" background="../../images/buttom_bgs.gif">
                <img src="../../images/buttom_bgs.gif" width="17" height="17" />
            </td>
            <td background="../images/mail_rightbg.gif">
                <img src="../../images/buttom_right2.gif" width="16" height="17" />
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
